
package Pemilik;

import Kasir.Kasir;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Astri
 */
public class TambahKasirTabelModel extends AbstractTableModel {
       private List<Kasir> kasir = new ArrayList<Kasir>();

public TambahKasirTabelModel(List<Kasir> kasir){
    this.kasir = kasir;
}       
    public int getRowCount() {
        return kasir.size();
    }

    public int getColumnCount() {
        return 5;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
       Kasir k =kasir.get(rowIndex);
       switch(columnIndex){
           case 0:            
               return k.getId_Kasir();
           case 1 :
               return  k.getNama_Kasir();
           case 2 :            
               return k.getAlamat();
           case 3 :
               return  k.getPassword();
           case 4 :            
               return k.getStatus();
                    
           default :
               return "";
       }
    }
    public String getColumnName (int column){
        switch(column){
            case 0 : 
                return "Id Kasir";
            case 1 : 
                return "Nama Kasir";
            case 2 : 
                return "Alamat";
            case 3 : 
                return "Password";
            case 4 : 
                return "Status";
            
             default:
                 return "";
        }
    }

}
